/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

package org.maze.configuration;

import org.jdom.Element;

/**
 *
 * @author tpasquie
 */
public class PopulationConfiguration {
    private static final String VILLAGES_TAG = "Villages";
    private static final String INDIVIDUAL_CONFIGURATION_TAG = "IndividualConfiguration";
    private static final String NAME_TAG = "Name";
    private static final String POPULATION_SIZE_TAG = "PopulationSize";

    private IndividualConfiguration iConf=null;
    private String name;
    private int nbVillages;
    private int populationSize;

    public PopulationConfiguration(Element e) throws Exception{
        iConf = new IndividualConfiguration(e.getChildText(INDIVIDUAL_CONFIGURATION_TAG));
        name = e.getChildText(NAME_TAG);
        nbVillages = Integer.parseInt(e.getChildText(VILLAGES_TAG));
        populationSize = Integer.parseInt(e.getChildText(POPULATION_SIZE_TAG));
    }

    public IndividualConfiguration getIndividualConf(){
        return iConf;
    }

    public String getName(){
        return name;
    }

    public int getNbVillages(){
        return nbVillages;
    }

    public int getPopulationSize(){
        return populationSize;
    }
}
